<template>
	<view class="pages">
		<h-nav-bar-yun :title="barTitle" :fixed="true" @clickLeft="clickLeft"></h-nav-bar-yun>
		<view v-if="status == -1">
			<view class="section">
				<view class="sec_head">基本信息</view>
				<view class="sec_input">
					<view class="sec_input_label left"><text>*</text>姓名</view>
					<view>
						<input class="sec_input_input" type="text" :disabled="Boolean(oldDetail?.name)&&oneAudit==2" :value="userInfo?.name" @input="onKeyInputName" maxlength="4" placeholder-class="sec_input_input_p" placeholder="请输入真实姓名" />
					</view>
				</view>
				<view class="sec_input">
					<view class="sec_input_label left"><text>*</text>性别</view>
					<view class="right" style="width: 240rpx">
						<view class="sec_input_radio flex" v-for="(item, index) in sexList" :key="index" @click="checkSex(item.value)">
							<image v-show="userInfo?.sex != item.value" src="@/static/index/chc.png" class="sec_input_radio_l"></image>
							<image v-show="userInfo?.sex == item.value" src="@/static/index/chb.png" class="sec_input_radio_l"></image>
							<view class="sec_input_radio_r">{{ item.label }}</view>
						</view>
					</view>
				</view>
				<view class="sec_input">
					<view class="sec_input_label" style="margin: 20rpx 0"><text>*</text>医生签名</view>
					<view class="sec_input_qian" @click="toSign">
						<view v-show="!userInfo?.signature" class="sec_input_qian_btn">
							<image src="@/static/index/qian.png" class="sec_input_qian_btn_img"></image>录入
						</view>
						<image v-show="userInfo?.signature" :src="userInfo?.signature" class="sec_input_qian_img"></image>
						<view v-show="userInfo?.signature" class="sec_input_qian_cl" @click.stop="userInfo.signature = ''">
							<u-icon name="close-circle-fill" color="rgba(32,32,32,0.4)" size="18"></u-icon>
						</view>
					</view>
				</view>
				<view class="sec_input">
					<view class="sec_input_label"><text>*</text>身份证号</view>
					<view>
						<input class="sec_input_input" type="idcard" :disabled="Boolean(oldDetail?.idCard)&&oneAudit==2" maxlength="18" :value="userInfo?.idCard" placeholder-class="sec_input_input_p" @input="onKeyInputIdCard" placeholder="请输入身份证号" />
					</view>
				</view>
				<view class="sec_input">
					<view class="sec_input_label"><text>*</text>学历</view>
					<view class="flex" @click="educationRank=true">
						<view :class="educationName ? 'sec_input_input' : 'sec_input_input_p'">{{ educationName || '请选择你的学历' }}</view>
						<image src="@/static/index/right.png" class="sec_input_input_img"></image>
					</view>
				</view>
				<view class="sec_input">
					<view class="sec_input_label">医院等级</view>
					<view class="flex" @click="gradeRank = true">
						<view :class="gradeName ? 'sec_input_input' : 'sec_input_input_p'">{{ gradeName || '请选择你的医院等级' }}</view>
						<image src="@/static/index/right.png" class="sec_input_input_img"></image>
					</view>
				</view>
				<view class="sec_input">
					<view class="sec_input_label">在职医院</view>
					<view>
						<input class="sec_input_input" type="text" :disabled="Boolean(oldDetail?.hospital_name)&&oneAudit==2" key="f" :value="userInfo?.hospital_name" maxlength="20" placeholder-class="sec_input_input_p" @input="onKeyInputHospital" placeholder="请输入医院全称" />
					</view>
				</view>
				<!--<view class="sec_input">
					<view class="sec_input_label">科室</view>
					<view class="flex" @click="navigateTo('/pages-users/my-page/myOffice')">
						<view :class="userInfo.rf_name.length>0 ? 'sec_input_input' : 'sec_input_input_p'">{{ userInfo.rf_name.toString() || '请选择科室' }}
						</view>
						<image src="@/static/index/right.png" v-show="oldRfName.length==0" class="sec_input_input_img"></image>
					</view>
				</view>-->
				<view class="sec_input">
					<view class="sec_input_label">职称</view>
					<view class="flex" @click="checkLabel">
						<view :class="level ? 'sec_input_input' : 'sec_input_input_p'">{{ level || '请选择职称' }}</view>
						<image src="@/static/index/right.png" class="sec_input_input_img" v-show="!level&&!oldLabel"></image>
						<image src="@/static/index/chaa.png" class="sec_input_input_img" v-show="level&&!oldLabel" style="margin-left: 14rpx;" @click.stop="rankClear"></image>
					</view>
				</view>
			</view>
			<view class="section">
				<view class="sec_title"><text>*</text>请上传本人身份证正反面</view>
				<view class="sec_idenImg" v-show="userInfo?.identity[0]">
					<image class="sec_idenImg" :src="userInfo?.identity[0]" mode="aspectFit"></image>
					<view class="sec_idenImg_cl" @click="userInfo.identity[0] = '',userInfo.id_card_font=''">
						<u-icon name="close-circle-fill" color="rgba(32,32,32,0.4)" size="18"></u-icon>
					</view>
				</view>
				<view v-show="!userInfo?.identity[0]" class="sec_idenImg" @click="upIdenImg(0)">
					<view>
						<image class="sec_idenImg_add" src="@/static/index/upsfz.png"></image>
						<view class="sec_idenImg_text">请上传身份证正面</view>
					</view>
				</view>
				<view style="margin-top: 20rpx; margin-bottom: 30rpx" class="sec_idenImg" v-show="userInfo?.identity[1]">
					<image class="sec_idenImg" :src="userInfo?.identity[1]" mode="aspectFit"></image>
					<view class="sec_idenImg_cl" @click="userInfo.identity[1] = '',userInfo.id_card_opposite=''">
						<u-icon name="close-circle-fill" color="rgba(32,32,32,0.4)" size="18"></u-icon>
					</view>
				</view>
				<view style="margin-top: 20rpx; margin-bottom: 30rpx" v-show="!userInfo?.identity[1]" class="sec_idenImg" @click="upIdenImg(1)">
					<view>
						<image class="sec_idenImg_add" src="@/static/index/upsfz.png"></image>
						<view class="sec_idenImg_text">请上传身份证背面</view>
					</view>
				</view>
			</view>
			<view class="section">
				<view class="sec_title"><text>*</text>身份证有效期限</view>
				<view class="sec_time clear">
					<view class="sec_time_input left" @click="cardTime(0)">
						<view :class="userInfo?.idCardTime[0] ? 'sec_time_input' : 'sec_input_input_p'">{{userInfo?.idCardTime[0] || '请选择生效日期'}}</view>
					</view>
					<view class="sec_time_cen left">至</view>
					<view class="sec_time_input left" @click="cardTime(1)">
						<view :class="userInfo?.idCardTime[1] ? 'sec_time_input' : 'sec_input_input_p'">{{userInfo?.idCardTime[1] || '请选择到期日期'}}</view>
					</view>
				</view>
			</view>
			<view class="section">
				<view class="sec_title"><text>*</text>请上传个人白大褂形象照片</view>
				<view class="sec_ti">请上传身着白大褂高清形象图，提高患者信任度</view>
				<view class="sex_image">
					<view class="sex_image_l" v-show="userInfo?.white_gown">
						<image class="sex_image_l" :src="userInfo?.white_gown" mode="aspectFit"></image>
						<view class="sex_image_l_cl" @click="userInfo.white_gown = ''">
							<u-icon name="close-circle-fill" color="rgba(32,32,32,0.4)" size="18"></u-icon>
						</view>
					</view>
					<view class="sex_image_l" v-show="!userInfo?.white_gown" @click="upIdenImg(2)">
						<view>
							<image class="sex_image_l_add" src="@/static/index/upsfz.png"></image>
							<view class="sex_image_l_text">点击添加</view>
						</view>
					</view>
				</view>
			</view>

			<view class="section">
				<view class="sec_title">医师职业证书</view>
				<view class="sec_box flex">
					<view class="sec_box_img" v-for="(item, index) in userInfo?.doctor_practicing_certificate" :key="index">
						<image class="sec_box_img_img" :src="item" mode="aspectFit"></image>
					</view>
				</view>
			</view>
			<view class="section">
				<view class="sec_title">医师资格证书</view>
				<view class="sec_box flex">
					<view class="sec_box_img" v-for="(item, index) in userInfo?.doctor_qualification" :key="index">
						<image class="sec_box_img_img" :src="item" mode="aspectFit"></image>
					</view>
				</view>
			</view>
			<h-line :height="132+bottoms"></h-line>
			<view class="foot">
				<view class="foot_btn" @click="submit">提交审核</view>
				<h-line :height="bottoms"></h-line>
			</view>
		</view>

		<view v-if="status == 0">
			<view class="audit">
				<view class="audit_box">
					<image class="audit_box_img" src="@/static/index/audit.png"></image>
					<view class="audit_box_t">已提交审核</view>
					<view class="audit_box_b">本次审核预计在1-7个工作日内完成，请您耐心等待</view>
				</view>
			</view>
		</view>
		<view v-if="status == 2">
			<view class="section">
				<view class="sec_wei">
					<image class="sec_wei_img" src="@/static/index/wei.png"></image>{{barTitle}}审核未通过
				</view>
				<view class="sec_wei_box">
					<!--<view class="sec_l">1、身份证号码格式错误；</view>
					<view class="sec_l">2、在职医院次查询不到任职信息；</view>
					<view class="sec_l">3、职业医师资格证书模糊不清；</view>
					<view class="sec_l">4、医院等级错误；</view>-->
					<view class="sec_l">{{ reason_rejection }}</view>
				</view>
			</view>
			<h-line :height="132+bottoms"></h-line>
			<view class="foot">
				<view class="foot_btn" @click="status = -1,isAgain=true">再次提交审核</view>
				<h-line :height="bottoms"></h-line>
			</view>
		</view>
		<h-modal :show="saveShow" titlea="您编辑的信息未提交，离开数据" titleb="将会丢失，是否确认返回" leftBtn="直接返回" rightBtn="保存后返回" @clear="navigateBack" @bind="submit"></h-modal>
		<h-authpup ref="authpup" :h="statusHeight" type="top" @changeAuth="changeAuth" permissionID="WRITE_EXTERNAL_STORAGE"></h-authpup>
		<h-sheet-new :show="showRank" :actions="actions" @close="rankClear" @clear="showRank=false" @select="rankSelect"></h-sheet-new>
		<h-sheet-new :show="gradeRank" :actions="gradeList" @close="gradeClear" @clear="gradeRank=false" @select="gradeSelect"></h-sheet-new>
		<h-sheet-new :show="educationRank" :actions="eduList" @close="educationClear" @clear="educationRank=false" @select="educationSelect"></h-sheet-new>
		<u-datetime-picker :show="cardStart" :maxDate="newTime" :formatter="formatter" v-model="startTime" mode="date" confirmColor="#00C1B9" :minDate="94656000000" @close="cardStart = false" @cancel="cardStart = false" :closeOnClickOverlay="true" @confirm="onDateStart"></u-datetime-picker>
		<h-sheet :show="cardEnd" :actions="endList" @close="cardEnd=false" @select="endSelect"></h-sheet>
	</view>
</template>

<script setup lang="ts">
	import { ref, reactive, nextTick } from 'vue'
	import { formatDate } from '@/utils/utils'
	import { navigateTo, showToast, navigateBack, redirectTo } from '@/utils'
	import {
		onLoad,
		onPullDownRefresh,
		onReachBottom,
		onReady,
		onShow,
		onPageScroll,
		onUnload,
		onHide,
		onBackPress,
	} from '@dcloudio/uni-app'
	import { uploadApi } from '@/utils/upLoad'
	import { useMemberStore } from '@/stores'
	import {
		getOpenAuditStatus,
		getHospitalLevel,
		getEducationLevel,
		getDoctorAuditInfo,
		getDoctorLevel,
		getDoctorOpenTransaction,
	} from '@/api/business'
	const login = ref(null) // 登录组件实例
	const store = useMemberStore()
	var token = store?.token
	const showRank = ref(false)
	const level = ref('')
	const gradeRank = ref(false)
	const gradeName = ref('')
	const educationRank = ref(false)
	const educationName = ref('')
	const status = ref(-1)
	const signatureRef = ref(null)
	const authpup = ref(null)
	const authpupzi = ref(null)
	const bottoms=ref(0)
	const userInfo = ref({
		name: '',
		sex: '',
		idCard: '',
		signature: '',
		hospital_name: '',
		rf_name: '',
		type: '',
		hospital_level_id: '',
		education_id: '',
		doctor_practicing_certificate: ['', ''],
		doctor_qualification: ['', ''],
		identity: ['',''],
		idCardTime: ['', ''],
		white_gown: '',
		id_card_font: '',
		id_card_opposite: '',
		id_card_effective_date: '',
		id_card_due_date: '',
	})
	const reason_rejection = ref('')
	const startTime = ref(formatDate(new Date(), 'YYYY-MM-DD'))
	const endTime = ref(formatDate(new Date(), 'YYYY-MM-DD'))
	const newTime = ref(new Date().getTime())
	const sexList = ref([{
			label: '男',
			value: '1',
		},
		{
			label: '女',
			value: '0',
		},
	])
	const actions = ref([])
	const eduList = ref([])
	const gradeList = ref([])
	const statusHeight = ref(0)
	const oldName = ref("")
	const oldIdCard = ref("")
	const endList=ref([{
		name:"",
		value:""
	},{
		name:"",
		value:""
	},{
		name:"长期",
		value:"长期"
	}])
	var props = defineProps({
		id: String,
		title: String,
	})
	const barTitle=ref("")
	const isEdit=ref(false)
	const oneAudit=ref(-1)
	onLoad((o) => {
		barTitle.value=props.title+'业务开通'
		getStatus()
		getHospital()
		getEducation()
		getDoctorLevelList()
		getEndList(formatDate(new Date(), 'YYYY-MM-DD'))
		nextTick(() => {
			getAuditDetail()
		})
	})
	onShow(() => {
		const img=uni.getStorageSync('signUrl')
		if(img){
			isEdit.value=true
			userInfo.value.signature=img
			uni.removeStorageSync('signUrl')
		}
	})
	onReady(() => {
		uni.getSystemInfo({
			success: (e) => {
				statusHeight.value = e.statusBarHeight * 2
				bottoms.value = e.safeAreaInsets.bottom*2
			},
		})
	})
	const cardStart = ref(false)
	const cardEnd = ref(false)
	const oldHospitalName=ref("")
	const oldRfName=ref("")
	const oldLabel=ref("")
	const endIndex=ref(0)
	const oldDetail=ref({})
	function getEndList(time){
		const year=Number(formatDate(new Date(time),'YYYY'))
		const md=formatDate(new Date(time),'MM-DD')
		console.log(md)
		var yy=""
		var ee=""
		if(md=="12-31"){
			yy=year+9
			ee=year+19
		}else{
			yy=year+10
			ee=year+20
		}
		endList.value[0].name=yy+'-'+md
		endList.value[0].value=yy+'-'+md
		endList.value[1].name=ee+'-'+md
		endList.value[1].value=ee+'-'+md
	}
	function disList(list) {
		var arr = []
		for(var i in list) {
			arr.push({
				name: list[i].name || list[i].title,
				value: list[i].id,
			})
		}
		return arr
	}
	async function getAuditDetail() {
		const res = await getDoctorAuditInfo()
		oldName.value = res?.data?.name;
		oldIdCard.value = res?.data?.idCard;
		oldHospitalName.value = res?.data?.hospital_name||null;
		oldRfName.value = res?.data?.rf_name||null;
		oldLabel.value=res?.data?.level;
		var data = {
			name: res?.data?.name,
			sex:res?.data?.sex.toString(),
			idCard: res?.data?.idCard,
			signature:res?.data?.signature,
			hospital_name: res?.data?.hospital_name,
			rf_name: res?.data?.rf_name,
			type: '0',
			hospital_level_id:res?.data?.hospital_level_id,
			education_id: res?.data?.education_id,
			doctor_practicing_certificate: res?.data?.doctor_practicing_certificate,
			doctor_qualification: res?.data?.doctor_qualification,
			identity: [res?.data?.id_card_font, res?.data?.id_card_opposite],
			idCardTime: [res?.data?.id_card_effective_date, res?.data?.id_card_due_date],
			white_gown:res?.data?.white_gown,
			id_card_font: res?.data?.id_card_font,
			id_card_opposite:res?.data?.id_card_opposite,
			id_card_effective_date:res?.data?.id_card_effective_date,
			id_card_due_date:res?.data?.id_card_due_date,
			level_id: res?.data?.level_id,
		}
		level.value = res?.data?.level
		userInfo.value = data
		oldDetail.value = data
		console.log()
		console.log(Boolean(oldDetail.value?.hospital_name)&&oneAudit.value==2)
		educationName.value =getName(eduList.value,res?.data?.education_id)
		gradeName.value=getName(gradeList.value,res?.data?.hospital_level_id)
	}
	function getName(list,id){
		console.log(list,id)
		for(var i in list){
			if(id==list[i].value){
				return list[i].name||list[i].title
			}
		}
	}
	const isAgain=ref(false)
	const saveShow=ref(false)
	function clickLeft() {
		if(isEdit.value){
			saveShow.value=true
		}else{
			if(isAgain.value){
				if(status.value == 2){
					navigateBack()
				}else{
					status.value = 2
				}
			}else{
				navigateBack()
			}
		}
	}
	async function getDoctorLevelList() {
		const res = await getDoctorLevel()
		var list = res?.data || []
		actions.value = disList(list)
	}
	async function getStatus() {
		const res = await getOpenAuditStatus({
			transaction_id: props.id,
		})
		if(res.code == 200) {
			status.value = res?.data?.status //-1 未提交过审核 0待审核 1已通过 2已驳回
			oneAudit.value=2
			if(res?.data?.status == 2) {
				reason_rejection.value = res?.data?.reason_rejection
			}
		}
	}
	async function getHospital() {
		const res = await getHospitalLevel()
		var list = res?.data || []
		gradeList.value = disList(list)
	}
	async function getEducation() {
		const res = await getEducationLevel()
		var list = res?.data || []
		eduList.value = disList(list)
	}
	function checkLabel(){
		if(oldDetail.value.level_id&&oneAudit.value==2){
			return false;
		}
		showRank.value = true
	}
	function onKeyInputName(e) {
		isEdit.value=true
		userInfo.value.name = e.detail.value
	}

	function checkSex(type) {
		isEdit.value=true
		userInfo.value.sex = type.toString()
	}

	function toSign() {
		navigateTo("/pages-users/business-management/sign?img="+userInfo.value.signature)
	}

	function onKeyInputIdCard(e) {
		isEdit.value=true
		userInfo.value.idCard = e.detail.value
	}

	function onKeyInputHospital(e) {
		isEdit.value=true
		userInfo.value.hospital_name = e.detail.value
	}

	function onKeyInputOffice(e) {
		isEdit.value=true
		userInfo.value.rf_name = e.detail.value
	}

	function rankSelect(e) {
		isEdit.value=true
		level.value = e.name
		userInfo.value.level_id = e.value
	}
	function rankClear(){
		level.value = ""
		userInfo.value.level_id =""
		showRank.value = false
	}

	function gradeSelect(e) {
		isEdit.value=true
		gradeName.value = e.name
		userInfo.value.hospital_level_id = e.value
	}

	function gradeClear() {
		isEdit.value=true
		gradeName.value = ""
		userInfo.value.hospital_level_id = ""
		gradeRank.value=false
	}

	function educationSelect(e) {
		isEdit.value=true
		educationName.value = e.name
		userInfo.value.education_id = e.value
	}

	function educationClear() {
		isEdit.value=true
		educationName.value = ""
		userInfo.value.education_id =""
		educationRank.value=false
	}

	function cardTime(num) {
		if(num == 0) {
			cardStart.value = true
			startTime.value = startTime.value || new Date()
		} else {
			cardEnd.value = true
			endTime.value = endTime.value || new Date()
		}
	}

	function formatter(type, value) {
		if(type === 'year') {
			return `${value}年`
		}
		if(type === 'month') {
			return `${value}月`
		}
		if(type === 'day') {
			return `${value}日`
		}
		return value
	}
	const upCardIndex=ref(0)
	function upIdenImg(index) {
		upCardIndex.value = index
		nextTick(() => {
			authpup.value.open()
		})

	}

	function changeAuth() {
		uni.chooseImage({
			count: 1, //默认9
			sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
			sourceType: ['album'], //从相册选择
			success: async function(res) {
				/* #ifdef APP-PLUS */
				const extension = res.tempFilePaths[0].split('.').pop();
				const arr = ['jpg', 'png', 'jpeg','JPG', 'PNG', 'JPEG'];
				if (extension && !arr.includes(extension)){
					uni.showToast({ title: '图片格式仅支持JPG、PNG、JPEG',icon: 'none' })
					return false;
				}
				/* #endif */
				const index=upCardIndex.value;
				const url = await uploadApi(res.tempFilePaths[0])
				isEdit.value=true
				if(index == 0 || index == 1) {
					userInfo.value.identity[index] = url
					if(index == 0) {
						userInfo.value.id_card_font = url
					} else {
						userInfo.value.id_card_opposite = url
					}
				} else if(index == 2) {
					userInfo.value.white_gown = url
				}
			}
		})
	}

	function onDateStart(e) {
		var time = formatDate(new Date(e.value), 'YYYY-MM-DD')
		var start = new Date(e.value).getTime()
		var end = new Date(userInfo.value.idCardTime[1]).getTime()
		if(end && Number(start) > Number(end)) {
			showToast('生效日期不能在结束日期后！')
			return false
		}
		isEdit.value=true
		startTime.value = time
		cardStart.value = false
		userInfo.value.idCardTime[0] = time
		userInfo.value.id_card_effective_date = time
		getEndList(time)
		userInfo.value.idCardTime[1]=endList.value[endIndex.value].name
		userInfo.value.id_card_due_date = endList.value[endIndex.value].name
	}
	function endSelect(e,index){
		isEdit.value=true
		userInfo.value.idCardTime[1] = e.name
		endIndex.value=index
		userInfo.value.id_card_due_date = e.name
	}
	const saveLoading=ref(false)
	async function submit() {
		if(saveLoading.value){return false;}
		saveLoading.value=true
		if(!userInfo.value.name) {
			showToast('请输入姓名')
			saveLoading.value=false
			return false
		}
		if(userInfo.value.name.length < 2) {
			saveLoading.value=false
			showToast('姓名最少输入两个字')
			return false
		}
		if(!userInfo.value.sex) {
			saveLoading.value=false
			showToast('请选择性别')
			return false
		}
		if(!userInfo.value.signature) {
			saveLoading.value=false
			showToast('请签名')
			return false
		}
		if(!userInfo.value.idCard) {
			saveLoading.value=false
			showToast('请输入身份证号')
			return false
		}
		if(!/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/.test(
				userInfo.value.idCard,
			)) {
			saveLoading.value=false
			showToast('请输入正确的身份证号')
			return false
		}
		if(!userInfo.value.education_id) {
			saveLoading.value=false
			showToast('请选择学历')
			return false
		}
		if(userInfo.value.hospital_name && userInfo.value.hospital_name.length < 2) {
			showToast('医院名称最少输入两个字')
			saveLoading.value=false
			return false
		}
		if(userInfo.value.rf_name && userInfo.value.rf_name.length < 2) {
			showToast('科室名称最少输入两个字')
			saveLoading.value=false
			return false
		}
		if(!userInfo.value.id_card_font) {
			showToast('请选择身份证正面')
			saveLoading.value=false
			return false
		}
		if(!userInfo.value.id_card_opposite) {
			showToast('请选择身份证反面')
			saveLoading.value=false
			return false
		}
		if(!userInfo.value.id_card_effective_date) {
			showToast('请选择生效日期')
			saveLoading.value=false
			return false
		}
		if(!userInfo.value.id_card_due_date) {
			showToast('请选择到期日期')
			saveLoading.value=false
			return false
		}
		if(!userInfo.value.white_gown) {
			showToast('请上传个人白大褂形象照片')
			saveLoading.value=false
			return false
		}
		const res = await getDoctorOpenTransaction({
			transaction_id: props.id,
			sex: userInfo.value.sex,
			signature: userInfo.value.signature,
			education_id: userInfo.value.education_id,
			hospital_level_id: userInfo.value.hospital_level_id,
			hospital_name: userInfo.value.hospital_name,
			rf_name: userInfo.value.rf_name,
			level_id: userInfo.value.level_id,
			type: userInfo.value.type,
			id_card_font: userInfo.value.id_card_font,
			id_card_opposite: userInfo.value.id_card_opposite,
			id_card_effective_date: userInfo.value.id_card_effective_date,
			id_card_due_date: userInfo.value.id_card_due_date,
			white_gown: userInfo.value.white_gown,
		})
		isEdit.value=false
		saveShow.value=false
		if(res.code == 200) {
			showToast(res.message)
			setTimeout(function(){
				uni.navigateBack({
					delta: 1
				})
				saveLoading.value=false
			},1000)
		} else {
			saveLoading.value=false
			showToast(res.message)
		}
	}
</script>

<style>
	page {
		background: #f5f6f8;
	}
</style>
<style lang="scss" scoped>
	.pages {
		box-sizing: border-box;
		padding: 0 24rpx;
		width: 750rpx;
		overflow: hidden;
	}

	.flex {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
	}

	.clear:after {
		/*START 真正起到清除浮动的代码*/
		content: '';
		display: block;
		clear: both;
		/*END 真正起到清除浮动的代码*/
		height: 0;
	}

	.clear {
		display: inline-block;
	}

	.left {
		float: left;
	}

	.right {
		float: right;
	}

	.audit {
		width: 100%;
		height: 80vh;
		display: flex;
		flex-direction: row;
		/* 子元素横向排列 */
		justify-content: center;
		/* 相对父元素水平居中 */
		align-items: center;
		.audit_box {
			text-align: center;
			.audit_box_img {
				width: 246rpx;
				height: 200rpx;
			}
			.audit_box_t {
				font-family: PingFangSC, PingFang SC;
				font-weight: 500;
				font-size: 30rpx;
				color: #202020;
				line-height: 42rpx;
				padding: 20rpx 0;
			}
			.audit_box_b {
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 26rpx;
				color: #aaaaaa;
				line-height: 37rpx;
			}
		}
	}

	.qian_box_head {
		width: 750rpx;
		position: fixed;
		top: 0;
		left: 0;
		border-bottom: 1rpx dashed #aaaaaa;
		z-index: 100000;
		.qian_box_head_box {
			width: 750rpx;
			height: 100rpx;
			box-sizing: border-box;
			padding-right: 84rpx;
			image {
				width: 40rpx;
				height: 40rpx;
				float: left;
				margin: 30rpx 24rpx;
			}
			.qian_box_head_box_cen {
				text-align: center;
				line-height: 100rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 36rpx;
				color: #202020;
				width: 100%;
			}
		}
	}


	.section {
		width: 702rpx;
		background: #ffffff;
		border-radius: 20rpx;
		padding: 0 20rpx;
		margin-top: 20rpx;
		overflow: hidden;
		.sec_wei {
			border-bottom: 1rpx solid #e8e8e8;
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 26rpx;
			color: #e75e56;
			line-height: 72rpx;
			.sec_wei_img {
				width: 26rpx;
				height: 26rpx;
				float: left;
				margin: 20rpx 10rpx 20rpx 0;
			}
		}
		.sec_wei_box {
			padding-top: 30rpx;
			padding-bottom: 20rpx;
			.sec_l {
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #202020;
				line-height: 48rpx;
			}
		}
		.sec_head {
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 30rpx;
			color: #202020;
			line-height: 42rpx;
			padding-top: 30rpx;
			text-align: left;
			font-style: normal;
		}
		.sec_title {
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #202020;
			line-height: 40rpx;
			padding-top: 30rpx;
			padding-bottom: 10rpx;
			text {
				color: #cb5000;
			}
		}
		.sec_ti {
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 26rpx;
			color: #aaaaaa;
			line-height: 37rpx;
			text-align: left;
			font-style: normal;
		}
		.sex_image {
			padding-top: 20rpx;
			padding-bottom: 30rpx;
			.sex_image_l {
				width: 240rpx;
				height: 320rpx;
				background: #f5f6f8;
				border-radius: 10rpx;
				text-align: center;
				position: relative;
				display: flex;
				flex-direction: row;
				/* 子元素横向排列 */
				justify-content: center;
				/* 相对父元素水平居中 */
				align-items: center;
				.sex_image_l_cl {
					position: absolute;
					top: 0;
					right: 0;
					padding: 20rpx 10rpx;
				}
				.sex_image_l_add {
					width: 60rpx;
					height: 54rpx;
				}
				.sex_image_l_text {
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #aaaaaa;
					line-height: 40rpx;
				}
			}
		}
		.sec_time {
			padding-bottom: 20rpx;
			width: 100%;
			.sec_time_input {
				width: 300rpx;
				border-bottom: 1rpx solid #f1f1f1;
				text-align: center;
				height: 120rpx;
				line-height: 120rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #202020;
			}
			.sec_time_cen {
				width: 62rpx;
				text-align: center;
				line-height: 120rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #202020;
			}
		}
		.sec_idenImg {
			width: 662rpx;
			height: 418rpx;
			background: #f5f6f8;
			border-radius: 20rpx;
			position: relative;
			background: url('/static/index/sfz.png') no-repeat;
			background-size: 100% 100%;
			text-align: center;
			display: flex;
			flex-direction: row;
			/* 子元素横向排列 */
			justify-content: center;
			/* 相对父元素水平居中 */
			align-items: center;
			.sec_idenImg_add {
				width: 100rpx;
				height: 90rpx;
			}
			.sec_idenImg_text {
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #aaaaaa;
				line-height: 40rpx;
				padding-top: 20rpx;
			}
			.sec_idenImg_cl {
				position: absolute;
				top: 0;
				right: 0;
				padding: 20rpx;
			}
		}
		.sec_input {
			border-bottom: 1rpx solid #f1f1f1;
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;
			.sec_input_label {
				line-height: 120rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #202020;
				text {
					color: #cb5000;
				}
			}
			.sec_input_qian {
				width: 200rpx;
				height: 120rpx;
				margin: 20rpx 0;
				display: flex;
				position: relative;
				flex-direction: row;
				/* 子元素横向排列 */
				justify-content: center;
				/* 相对父元素水平居中 */
				align-items: center;
				background: #f5f6f8;
				.sec_input_qian_img {
					width: 200rpx;
					height: 120rpx;
				}
				.sec_input_qian_btn {
					width: 130rpx;
					height: 50rpx;
					background: rgba(32, 32, 32, 0.2);
					border-radius: 25rpx;
					text-align: center;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 26rpx;
					color: #ffffff;
					line-height: 50rpx;
					.sec_input_qian_btn_img {
						width: 26rpx;
						height: 26rpx;
						margin-right: 10rpx;
					}
				}
				.sec_input_qian_cl{
					position: absolute;
					top: 10rpx;
					right: 10rpx;
				}
			}
			.sec_input_radio {
				width: 50%;
				float: left;
				box-sizing: border-box;
				padding-left: 50rpx;
				.sec_input_radio_l {
					width: 34rpx;
					height: 34rpx;
				}
				.sec_input_radio_r {
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #202020;
					line-height: 116rpx;
					padding-top: 4rpx;
				}
			}
			.sec_input_input {
				width: 450rpx;
				height: 120rpx;
				line-height: 120rpx;
				text-align: right;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 28rpx;
				color: #202020;
				border:none;
			}
			.sec_input_input_img{
				width: 30rpx;
				height: 30rpx;
				position: relative;
				top: -2rpx;
			}
		}
		.sec_input_input_p {
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #aaaaaa;
			line-height: 120rpx;
		}
		.sec_text {
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 26rpx;
			color: #aaaaaa;
			line-height: 37rpx;
			padding-bottom: 30rpx;
		}
		.sec_box {
			padding-bottom: 30rpx;
			.sec_box_img {
				width: 321rpx;
				height: 250rpx;
				background: #f5f6f8;
				border-radius: 10rpx;
				position: relative;
				.sec_box_img_img,
				.sec_box_img_add {
					width: 100%;
					height: 100%;
					position: absolute;
					top: 0;
					left: 0;
					border-radius: 16rpx;
				}
				.sec_box_img_add {
					display: flex;
					flex-direction: row;
					/* 子元素横向排列 */
					justify-content: center;
					/* 相对父元素水平居中 */
					align-items: center;
					box-sizing: border-box;
					padding-bottom: 50rpx;
					image {
						width: 66rpx;
						height: 66rpx;
					}
				}
				.sec_box_img_bot {
					width: 321rpx;
					height: 50rpx;
					background: rgba(32, 32, 32, 0.3);
					border-radius: 0rpx 0rpx 10rpx 10rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 26rpx;
					color: #ffffff;
					line-height: 50rpx;
					text-align: center;
					position: absolute;
					bottom: 0;
					left: 0;
				}
			}
		}
	}

	.foot {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 750rpx;
		background: #ffffff;
		.foot_btn {
			width: 702rpx;
			height: 88rpx;
			background: #00c1b9;
			border-radius: 48rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 32rpx;
			color: #ffffff;
			line-height: 88rpx;
			text-align: center;
			margin: 12rpx auto;
		}
	}
</style>
